<template>
  <view class="width-card">
    <view class="header">
      <image class="avatar" :src="info.pic || defaultAvatar"></image>
      <view class="info">
        <view class="name">{{ info.iname }}</view>
        <view class="good-box">
          <image :src="good" class="good"></image>
          <text>擅长：</text>
          <text>{{ info.goodAt }}</text>
        </view>
      </view>
    </view>
    <view class="desc">
      <image :src="collectFold" class="img"></image>
      <text class="score">{{ info.star }}</text>
      <text class="line"></text>
      <text class="mt16"
        >服务过
        <text class="count">{{
          info.serviceCount.slice(0, info.serviceCount.length - 1, 1)
        }}</text>
        人</text
      >
      <!-- <text class="line"></text>
      <text class="mt16"
        >从业 <text class="count">{{ info.exp }}</text> 年</text
      > -->
    </view>
    <view class="btn" @click="consultantOnline">
      <image :src="message" class="message"></image>
      <text class="text">在线咨询 ＞</text>
    </view>
  </view>
</template>

<script>
export default {
  components: {},
  name: 'WidthCard',
  props: {
    info: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      defaultAvatar: this.$imgBase + 'common/avatar_default.png',
      collectFold: this.$imgBase + 'career/collectFold.png',
      message: this.$imgBase + 'career/message.png',
      good: this.$imgBase + 'career/good.png',
      rightArrow: this.$imgBase + 'career/right-arrow.png'
    };
  },
  onLoad(opt) {},
  onShow() {},
  mounted() {},
  created() {},
  methods: {
    consultantOnline() {
      this.$emit('consultantOnline', this.info.consultantId);
    }
  }
};
</script>
<style lang="scss" scoped>
.width-card {
  padding: 24rpx 0 32rpx 0;
  .header {
    display: flex;
    align-items: center;
    .avatar {
      width: 96rpx;
      height: 96rpx;
      border-radius: 50%;
      margin-right: 26rpx;
    }
    .info {
      font-size: 26rpx;
      .name {
        font-size: 28rpx;
        color: #222;
        font-weight: 600;
      }
      .good-box {
        display: flex;
        align-items: center;
        margin-top: 16rpx;
        .good {
          width: 36rpx;
          height: 36rpx;
          margin-right: 14rpx;
          color: #555;
        }
      }
    }
  }
  .desc {
    display: flex;
    align-items: center;
    margin-top: 24rpx;
    color: #888;
    .img {
      width: 32rpx;
      height: 30rpx;
      margin-right: 20rpx;
    }
    .score {
      font-size: 30rpx;
      color: #222;
      font-weight: 600;
    }
    .line {
      width: 2rpx;
      height: 28rpx;
      margin: 0 25rpx;
      background-color: #e6e6e6;
    }
    .count {
      color: #222;
      padding: 0 12rpx;
      font-weight: 600;
      font-size: 30rpx;
    }
  }
}
.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffefd7;
  border-radius: 12rpx;
  color: #f76c3e;
  font-size: 24rpx;
  margin-top: 26rpx;
  width: 100%;
  height: 88rpx;
  line-height: 88rpx;
  .message {
    width: 32rpx;
    height: 28rpx;
  }
  .text {
    padding: 0 16rpx;
    font-weight: 600;
  }
}
</style>
